package org.x.user.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import lombok.Data;

/**
 * 租户信息表
 * @TableName sys_tenants
 */
@TableName(value ="sys_tenants")
@Data
public class SysTenants {
    /**
     * 租户ID
     */
    @TableId
    private String id;

    /**
     * 租户名称
     */
    private String tenantName;

    /**
     * 租户描述
     */
    private String tenantDesc;

    /**
     * 创建人
     */
    private String createBy;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 修改人
     */
    private String updateBy;

    /**
     * 修改时间
     */
    private Date updateTime;

    /**
     * 租户编码
     */
    private String tenantCode;

    /**
     * 租户状态
     */
    private String tenantStatus;

    /**
     * 租户配置（存储配额/登录策略等）
     */
    private Object tenantConfig;

    /**
     * 超级管理员ID
     */
    private String adminId;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        SysTenants other = (SysTenants) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getTenantName() == null ? other.getTenantName() == null : this.getTenantName().equals(other.getTenantName()))
            && (this.getTenantDesc() == null ? other.getTenantDesc() == null : this.getTenantDesc().equals(other.getTenantDesc()))
            && (this.getCreateBy() == null ? other.getCreateBy() == null : this.getCreateBy().equals(other.getCreateBy()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateBy() == null ? other.getUpdateBy() == null : this.getUpdateBy().equals(other.getUpdateBy()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getTenantCode() == null ? other.getTenantCode() == null : this.getTenantCode().equals(other.getTenantCode()))
            && (this.getTenantStatus() == null ? other.getTenantStatus() == null : this.getTenantStatus().equals(other.getTenantStatus()))
            && (this.getTenantConfig() == null ? other.getTenantConfig() == null : this.getTenantConfig().equals(other.getTenantConfig()))
            && (this.getAdminId() == null ? other.getAdminId() == null : this.getAdminId().equals(other.getAdminId()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getTenantName() == null) ? 0 : getTenantName().hashCode());
        result = prime * result + ((getTenantDesc() == null) ? 0 : getTenantDesc().hashCode());
        result = prime * result + ((getCreateBy() == null) ? 0 : getCreateBy().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateBy() == null) ? 0 : getUpdateBy().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getTenantCode() == null) ? 0 : getTenantCode().hashCode());
        result = prime * result + ((getTenantStatus() == null) ? 0 : getTenantStatus().hashCode());
        result = prime * result + ((getTenantConfig() == null) ? 0 : getTenantConfig().hashCode());
        result = prime * result + ((getAdminId() == null) ? 0 : getAdminId().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", tenantName=").append(tenantName);
        sb.append(", tenantDesc=").append(tenantDesc);
        sb.append(", createBy=").append(createBy);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateBy=").append(updateBy);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", tenantCode=").append(tenantCode);
        sb.append(", tenantStatus=").append(tenantStatus);
        sb.append(", tenantConfig=").append(tenantConfig);
        sb.append(", adminId=").append(adminId);
        sb.append("]");
        return sb.toString();
    }
}